<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateConfigDiscover extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('config_discover', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->unsignedInteger('cooperative_id')->default(0)->comment('合作商id');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态 0:禁用 1:正常');
            $table->unsignedTinyInteger('type')->default(0)->comment('页面类型 1:任务页 2:活动页');
            $table->string('ext')->default('')->comment('根据type类型 type=1 存任务id，type=2 存活动页前端路由');
            $table->unsignedInteger('rank')->default(50)->comment('排序rank值，值越小越优先');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('config_discover');
    }
}
